#ifdef ZKBIOLOCK
#include <bluetooth_interface.h>
#include <ctype.h>
#include <pd_ios.h>

#include "CBluetoothManager.h"

CBluetoothManager *instance = CBluetoothManager::instance();

int BTInit(const char *BTAddress)
{
    return instance->connect((char *)BTAddress, 0, 0);
}

int BTFree(void)
{
    //instance->disconnect();
    return 0;
}

int BTWrite(char *buf, int offset, int count)
{
    UDK_DUMP("BTwrite", buf+offset, count);
    return instance->write(buf, offset, count);
}

int BTRead(char *buf, int offset, int count)
{
    int ret;
    ret = instance->read(buf, offset, count);
    if (ret > 0) {
        UDK_DUMP("BTRead", buf+offset, ret);
    }
    return ret;
}

int BTSelect(void)
{
    return 0;
}

int BTClear()
{
    instance->clearBuffer();
    return 0;
}
#endif
